{config_load file="test.conf" section="setup"}
{include file="header.tpl" title={$titulo}}
{include file="menu.tpl"}

{strip}
<script type="text/javascript">
	$(document).ready(function(){
		$('#edit_usuario').submit(function() {
		  if ($("#nome").val() == "" || $("#nome").val().length < 3){
		  		$("span").text("Preencha o campo nome, com mais de 3 caracteres").show();
			    return false;
		  }
		  else if ($("#login").val() == "" || $("#login").val().length < 3){
		  		$("span").text("Preencha o campo login, com mais de 3 caracteres").show();
			    return false;
		  }
		  else if ($("#perfil").val() == 0){
		  		$("span").text("Selecione um perfil").show();
			    return false;
		  }
		  else{
		  		return true; 
		  } 
		});             
	});
</script>
{/strip}

<div class="container">
	
	<form method='POST' action='usuario.php' class="form-signin" id='edit_usuario'>
	   
	   <fieldset>
	    <legend>Editar Usuário</legend>
	    <label>Nome</label>
	    <input type="text" placeholder="nome do usuário" name='nome' id='nome' value='{$nome_usu}'>
	    
	    <label>Login</label>
	    <input type="text" placeholder="login de acesso" name='login' id='login' value='{$login}'>
	    
	    <label>Perfil</label>
	    <select name='perfil' id='perfil'>
	    	<option value='{$perfil}'>{$perfil}</option>
			<option value='adm'>Administrador</option>
			<option value='usu'>Usuário</option>
		</select>
	   
	   	<br />
	    <button type="submit" class="btn" value='salvar'>Alterar</button>
	    <span style='display: none;' class="alert alert-error"></span> 
	  </fieldset>
	  <input type='hidden' name='idusuario' value='{$idusuario}' />
	  <input type='hidden' name='action' value='editUsuario' />
	</form> 
	
</div> <!-- /container -->

{include file="footer.tpl"}